package com.wz.wiki.controller;

import com.wz.wiki.entity.resp.CommonResp;
import com.wz.wiki.entity.resp.StatisticResp;
import com.wz.wiki.service.EbookSnapshotService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * @author 王哲
 * @Contact 1121586359@qq.com
 * @ClassName EbookSnapshotController.java
 * @create 2023年07月03日 下午8:37
 * @Description 电子书快照控制层
 * @Version V1.0
 */
@RestController
@RequestMapping("/ebookSnapshot")
public class EbookSnapshotController {

    @Resource
    private EbookSnapshotService ebookSnapshotService;

    @GetMapping("/getStatistic")
    public CommonResp getStatistic() {
        List<StatisticResp> statisticResp = ebookSnapshotService.getStatistic();

        return CommonResp.success(statisticResp);
    }

    @GetMapping("/get30Statistic")
    public CommonResp get30Statistic() {
        List<StatisticResp> statisticResp = ebookSnapshotService.get30Statistic();

        return CommonResp.success(statisticResp);
    }

}
